package zmqTest;

import org.zeromq.ZContext;
import org.zeromq.ZMQ;

public class ZmqTest {
	
	private ZContext zmqContext;
	
	private ZMQ.Socket zmqPush;
	
	public ZmqTest() {
		this.zmqContext = new ZContext();
		
		this.zmqContext.setIoThreads(1);
		
		this.zmqPush = zmqContext.createSocket(ZMQ.PUSH);
		this.zmqPush.setLinger(3000);
		// 默认不限制消息缓存数量(可能会导致占用过多内存)
		this.zmqPush.setSndHWM(0);
		this.zmqPush.setReconnectIVL(2000);
		this.zmqPush.setReconnectIVLMax(5000);
		this.zmqPush.connect("tcp:\\127.0.0.1:5000");
	}
	
	
	public static void main(String[] args) {
		
	}
}
